import request from '@/utils/request'

// 查询单元列表
export function listUnitInfo(query) {
  return request({
    url: '/basic/unitInfo/list',
    method: 'get',
    params: query
  })
}

// 查询单元详细
export function getUnitInfo(unitId) {
  return request({
    url: '/basic/unitInfo/' + unitId,
    method: 'get'
  })
}

// 新增单元
export function addUnitInfo(data) {
  return request({
    url: '/basic/unitInfo',
    method: 'post',
    data: data
  })
}

// 修改单元
export function updateUnitInfo(data) {
  return request({
    url: '/basic/unitInfo',
    method: 'put',
    data: data
  })
}

// 删除单元
export function delUnitInfo(unitId) {
  return request({
    url: '/basic/unitInfo/' + unitId,
    method: 'delete'
  })
}

// 获取级联
export function cascade(){
  return request({
    url: '/basic/unitInfo/cascade',
    method: 'get'
  })
}
